<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        function User() {

        }
        User.prototype.show = function () {
            console.log(this.description())
        }
        function Admin() { }
        Admin.prototype = Object.create(User.prototype);
        Admin.prototype.description = function () {
            return '管理员在此'
        }
        function Member() { }
        Member.prototype = Object.create(User.prototype);
        Member.prototype.description = function () {
            return '我是会员'
        }
        function Enterprise() { }
        Enterprise.prototype = Object.create(User.prototype);
        Enterprise.prototype.description = function () {
            return '企业账号'
        }
        for (const item of [new Admin, new Member, new Enterprise]) {
            item.show(); // 根据不同的状态响应不同的结果
        }
    </script>
</body>

</html>